function get_xhr(){
	var xhr;
    if (window.XMLHttpRequest) { 
        xhr = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        xhr = new ActiveXObject("Microsoft.XMLHTTP");
    }
    return xhr;
}

function ajax_vote(idjoke,vote){
	var xhr;
    xhr = get_xhr();
    xhr.open("GET", "./index.php?ajax=vote&vote="+vote+"&idjoke="+idjoke, true);
    xhr.send(null);
}